<template>
  <div>
    <Modal title="导出" v-model="exportModel1" @on-ok="comfirmExport1" @on-cancel="backoutExport">
      <div>
        <p>是否确认导出清单？</p>
      </div>
    </Modal>
    <Modal title="导出" v-model="exportModel2" @on-ok="comfirmExport2" @on-cancel="backoutExport">
      <div>
        <p>是否确认导出结算？</p>
      </div>
    </Modal>
    <Modal title="导出" v-model="exportModel3" @on-ok="comfirmExport3" @on-cancel="backoutExport">
      <div>
        <p>是否确认导出汇总？</p>
      </div>
    </Modal>
    <Modal title="导出" v-model="exportModel4" @on-ok="comfirmExport4" @on-cancel="backoutExport">
      <div>
        <p>是否确认导出类别汇总？</p>
      </div>
    </Modal>
    <Modal title="放弃" v-model="abandonModal" @on-ok="comfirmabandon" @on-cancel="abandonCancel">
      <div>
        <p>是否确认放弃？</p>
      </div>
    </Modal>
    <div class="swith-btn">
      <Button type="warning" @click="createproject" :disabled="createBton">承接项目</Button>
      <Button type="success" @click="openExportMdel1" :disabled="exportBton">导出清单</Button>
      <Button type="success" @click="openExportMdel2" :disabled="exportBton">导出结算</Button>
      <Button type="success" @click="openExportMdel3" :disabled="exportBton">导出汇总</Button>
      <Button type="success" @click="openExportMdel4" :disabled="exportBton">类别汇总</Button>
    </div>
    <div class="search-bar">
      <div class="search-block">
        <Row type="flex">
          <Col span="18" order="2">
            <Cascader
            change-on-select
              @on-change="getValue($event)"
              style="width:200px"
              :data="dataTree"
              :render-format="format"
              :disabled="easySearchBton"
            ></Cascader>
          </Col>
          <Col span="6" order="1">承接部门:</Col>
        </Row>
      </div>
      <div class="search-block">
        <Row type="flex">
          <Col span="18" order="2">
            <Select
              ref="myperson"
              v-model="model1"
              style="width:200px"
              @on-change="getperId($event)"
              :label-in-value="true"
              :disabled="easySearchBton"
            >
              <Option v-for="item in personName" :value="item.id" :key="item.id">{{ item.name }}</Option>
            </Select>
          </Col>
          <Col span="6" order="1">承接人员:</Col>
        </Row>
        <!-- <span>承接人员:</span> -->
      </div>
      <div class="search-block1">
        <Row type="flex">
          <Col span="18" order="2">
            <Select
              v-model="model2"
              style="width:100px"
              @on-change="getyear($event)"
              :label-in-value="true"
              :disabled="easySearchBton"
            >
              <Option v-for="item in yearName" :value="item.id" :key="item.id">{{ item.name }}</Option>
            </Select>
          </Col>
          <Col span="6" order="1">年份:</Col>
        </Row>
        <!-- <span>年份:</span> -->
      </div>

      <!-- <div class="search-block">
        <span>承接部门:</span>
        <SelectTree
          :props="props"
          :options="dataTree"
          :value="valueId"
          :accordion="isAccordion"
          @getValue="getValue($event)"
        />
      </div>
      <div class="search-block">
        <span>承接人员:</span>
        <Select
          ref="myperson"
          v-model="model1"
          style="width:200px"
          @on-change="getperId($event)"
          :label-in-value="true"
          :disabled="easySearchBton"
        >
          <Option v-for="item in personName" :value="item.id" :key="item.id">{{ item.name }}</Option>
        </Select>
      </div>
      <div class="search-block">
        <span>年份:</span>
        <Select
          :disabled="easySearchBton"
          v-model="model2"
          @on-change="getyear($event)"
          :label-in-value="true"
        >
          <Option v-for="item in yearName" :value="item.id" :key="item.id">{{ item.name }}</Option>
        </Select>
      </div> -->
      <Button type="primary" @click="getNewData" :disabled="easySearchBton">搜索</Button>
      <div class="senior-search-block">
        <Button v-if="clearHigh" type="warning" @click="HighClear">清除高级条件</Button>
        <Poptip trigger="focus" content="包含高级查询内容">
          <Input class="search-content" v-model="keyword" :disabled="highWinButton" />
        </Poptip>
        <Button type="default" @click="OpenhihgLevelSearch" :disabled="highWinButton">高级查询</Button>

        <Button type="primary" @click="hihgLevelSearch" :disabled="highSearchBton">搜索</Button>
      </div>
      <div>
        <Table
          height="500"
          stripe
          border
          :columns="columns"
          :data="data"
          @on-selection-change="selectChange"
        ></Table>
      </div>
      <br />
      <div>
        <Page :total="totalDataNo" @on-change="getpageNum" />
      </div>
      <transition name="bidding-detail">
        <div class="bidding-block" v-if="undertakeDtaildetail">
          <div class="bidding-block-top">
            <div class="bidding-block-close" @click="closeundertakedtail">
              <!--左上角关闭动作-->
              <Icon type="md-close" />
            </div>
            <span>项目详情</span>
          </div>
          <div class="undertake-title">
            <button class="undertake-title" @click.prevent="which='easynews'">项目基本信息</button>
            <button class="undertake-title" @click.prevent="which='authorizenews'">编制信息</button>
            <button class="undertake-title" @click.prevent="which='finacenews'">财务信息</button>
            <button class="undertake-title" @click.prevent="which='projectprogress'">项目进展</button>
          </div>
          <keep-alive>
            <component
              v-bind:is="which"
              :callbackdata="callbackdata"
              :callbackState="callbackState"
            ></component>
          </keep-alive>
          <div>
            <Button type="primary" @click="closeundertakedtail">确定</Button>
          </div>
        </div>
      </transition>

      <transition name="bidding-create">
        <div class="bidding-block" v-if="undertakeCreate">
          <div class="bidding-block-top">
            <div class="bidding-block-close" @click="closeundertakeCreate">
              <!--左上角关闭动作-->
              <Icon type="md-close" />
            </div>
            <span>承接项目</span>
          </div>
          <div>
            <div class="bidding-body">
              <!-- <div class="bidding-title">
                <span>项目基本信息</span>
              </div>-->

              <div class="bidding-content">
                <Form ref="formCreate" :model="newinfo" :rules="ruleCreate" :label-width="150">
                  <div class="panel panel-default bidding-title">
                    <div class="panel-heading">
                      <h4 class="panel-title">默认信息</h4>
                    </div>
                    <div class="panel-body">
                      <br />
                      <div>
                        <div class="bidding-item">
                          <FormItem label="承接部门：" prop="undertakeDepartmentId">
                            <Input
                              class="bidding-item-input"
                              v-model="newinfo.undertakeDepartmentId"
                              disabled
                            />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="承接人员：" prop="undertakePersonId">
                            <Input
                              class="bidding-item-input"
                              v-model="newinfo.undertakePersonId"
                              disabled
                            />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="任务单编号：">
                            <Input
                              class="bidding-item-input"
                              v-model="newinfo.taskNumber"
                              disabled
                            />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="项目登记日期：" prop="registDate">
                            <Input
                              class="bidding-item-input"
                              v-model="newinfo.registDate"
                              disabled
                            />
                          </FormItem>
                        </div>
                      </div>
                    </div>
                  </div>

                  <div class="panel panel-default bidding-title">
                    <div class="panel-heading">
                      <h4 class="panel-title">完成信息</h4>
                    </div>
                    <div class="panel-body">
                      <br />
                      <div>
                        <div class="bidding-item">
                          <FormItem label="完成部门：" prop="finishDepartmentId">
                            <Select
                              v-model="newinfo.finishDepartmentId"
                              style="width:200px"
                              :label-in-value="true"
                              @on-change="getFinDep($event)"
                            >
                              <Option
                                v-for="item in dptList"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                            <!-- <Input class="bidding-item-input" v-model="newinfo.finishDepartmentId"/> -->
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="项目编制人员：" prop="editPersonId">
                            <Select
                              v-model="newinfo.editPersonId"
                              clearable
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in proEditPeo"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                            <!-- <Input class="bidding-item-input" v-model="newinfo.editPersonId"/> -->
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="任务下达日期：" prop="startDate">
                            <DatePicker style="width:200px" type="date" v-model="newinfo.startDate"></DatePicker>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="要求完成天数：" prop="timeLimit">
                            <Input class="bidding-item-input" v-model.trim="newinfo.timeLimit" />
                          </FormItem>
                        </div>
                      </div>
                    </div>
                  </div>

                  <div class="panel panel-default bidding-title">
                    <div class="panel-heading">
                      <h4 class="panel-title">项目信息</h4>
                    </div>
                    <div class="panel-body">
                      <br />
                      <div>
                        <div class="bidding-item">
                          <FormItem label="项目名称：" prop="name">
                            <Input class="bidding-item-input" v-model.trim="newinfo.name" />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="行业类别：" prop="industryType">
                            <Select
                              v-model="newinfo.industryType"
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in carerType"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                            <!-- <Input class="bidding-item-input" v-model="newinfo.industryType"/> -->
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="项目类别：" prop="type">
                            <Select
                              v-model="newinfo.type"
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in proType"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>

                            <!-- <Input class="bidding-item-input" v-model="newinfo.type"/> -->
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="合同日期：" prop="contractDate">
                            <DatePicker
                              style="width:200px"
                              type="date"
                              v-model="newinfo.contractDate"
                            ></DatePicker>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="项目经费：" prop="fund">
                            <Input class="bidding-item-input" v-model.trim="newinfo.fund" />
                            <p>万元</p>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="合同归属：" :label-width="97" prop="contractOrigin">
                            <Select
                              v-model="newinfo.contractOrigin"
                              clearable
                              style="width:150px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in contactOrgOption"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                            <!-- <Input class="bidding-item-input" v-model="newinfo.contractOrigin"/> -->
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="所属地区：" prop="province">
                            <Select
                              v-model="newinfo.province"
                              style="width:182px"
                              @on-change="choseProvince"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in province"
                                :value="item.value"
                                :key="item.id"
                              >{{ item.value }}</Option>
                            </Select>
                            <Select
                              v-model="newinfo.city"
                              style="width:182px"
                              @on-change="choseCity"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in shi1"
                                :value="item.value"
                                :key="item.id"
                              >{{ item.value }}</Option>
                            </Select>
                            <Select
                              v-model="newinfo.area"
                              style="width:182px"
                              @on-change="choseBlock"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in qu1"
                                :value="item.value"
                                :key="item.id"
                              >{{ item.value }}</Option>
                            </Select>
                            <!-- <Input class="bidding-item-input" v-model="newinfo.province"/> -->
                            <!-- <Input class="bidding-item-input" v-model="newinfo.city"/> -->
                            <!-- <Input class="bidding-item-input" v-model="newinfo.area"/> -->
                          </FormItem>
                        </div>
                      </div>
                    </div>
                  </div>

                  <div class="panel panel-default bidding-title">
                    <div class="panel-heading">
                      <h4 class="panel-title">建设单位信息</h4>
                    </div>
                    <div class="panel-body">
                      <br />
                      <div>
                        <div class="bidding-item">
                          <FormItem label="建设单位：" prop="developmentOrganization">
                            <Input
                              class="bidding-item-input"
                              v-model.trim="newinfo.developmentOrganization"
                            />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="地址：" prop="address">
                            <Input class="bidding-item-input" v-model.trim="newinfo.address" />
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="联系人：" prop="contact">
                            <Input class="bidding-item-input" v-model.trim="newinfo.contact" />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="联系方式：" prop="contactPhone">
                            <Input class="bidding-item-input" v-model.trim="newinfo.contactPhone" />
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="税号：" prop="taxNumber">
                            <Input class="bidding-item-input" v-model.trim="newinfo.taxNumber" />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="开户银行：" prop="bankName">
                            <Input class="bidding-item-input" v-model.trim="newinfo.bankName" />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="银行账号：" prop="bankAccount">
                            <Input class="bidding-item-input" v-model.trim="newinfo.bankAccount" />
                          </FormItem>
                        </div>
                      </div>
                    </div>
                  </div>

                  <div class="panel panel-default bidding-title">
                    <div class="panel-heading">
                      <h4 class="panel-title">其他</h4>
                    </div>
                    <div class="panel-body">
                      <br />
                      <div>
                        <div class="bidding-item">
                          <FormItem label="备注：" prop="remark">
                            <Input
                              v-model.trim="newinfo.remark"
                              type="textarea"
                              style="width: 910px"
                            />
                          </FormItem>
                        </div>
                      </div>
                    </div>
                  </div>

                  <div>
                    <Button type="primary" @click="submitCreate('formCreate')">确定</Button>
                    <Button @click="closeundertakeCreate">取消</Button>
                  </div>
                </Form>
              </div>
            </div>
          </div>
        </div>
      </transition>

      <transition name="bidding-edit">
        <div class="bidding-block" v-if="undertakeDtailedit">
          <div class="bidding-block-top">
            <div class="bidding-block-close" @click="closeundertakeedit">
              <!--左上角关闭动作-->
              <Icon type="md-close" />
            </div>
            <span>修改承接项目</span>
          </div>
          <div>
            <div class="bidding-body">
              <div class="bidding-content">
                <Form ref="editForm" :model="editinfo" :rules="ruleEdit" :label-width="150">
                  <div class="panel panel-default bidding-title">
                    <div class="panel-heading">
                      <h4 class="panel-title">默认信息</h4>
                    </div>
                    <div class="panel-body">
                      <br />
                      <div>
                        <div class="bidding-item">
                          <FormItem label="承接部门：" prop="undertakeDepartmentId">
                            <Select
                              v-model="editinfo.undertake_departmentId"
                              clearable
                              style="width:200px"
                              :label-in-value="true"
                              disabled
                            >
                              <Option
                                v-for="item in dptList"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                            <!-- <Input class="bidding-item-input" v-model="editinfo.undertake_departmentId" disabled/> -->
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="承接人员：" prop="undertakePersonId">
                            <Select
                              v-model="editinfo.undertakePersonId"
                              clearable
                              style="width:200px"
                              :label-in-value="true"
                              disabled
                            >
                              <Option
                                v-for="item in allPeo"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                            <!-- <Input class="bidding-item-input" v-model="editinfo.undertakePersonId" disabled/> -->
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="任务单编号：" prop="taskNumber">
                            <Input
                              class="bidding-item-input"
                              v-model="editinfo.taskNumber"
                              disabled
                            />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="项目登记日期：" prop="registDate">
                            <Input
                              class="bidding-item-input"
                              v-model="editinfo.registDate"
                              disabled
                            />
                          </FormItem>
                        </div>
                      </div>
                    </div>
                  </div>

                  <div class="panel panel-default bidding-title">
                    <div class="panel-heading">
                      <h4 class="panel-title">完成信息</h4>
                    </div>
                    <div class="panel-body">
                      <br />
                      <div>
                        <div class="bidding-item">
                          <FormItem label="完成部门：" prop="finishDepartmentId">
                            <Select
                              v-model="editinfo.finishDepartmentId"
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in dptList"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>

                            <!-- <Input class="bidding-item-input" v-model="editinfo.finishDepartmentId"/> -->
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="项目编制人员：" prop="editPersonId">
                            <Select
                              v-model="editinfo.editPersonId"
                              clearable
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in editPerList"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                            <!-- <Input class="bidding-item-input" v-model="editinfo.editPersonId"/> -->
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="任务下达日期：" prop="startDate">
                            <DatePicker
                              type="date"
                              style="width:200px"
                              v-model="editinfo.startDate"
                              format="yyyy-MM-dd"
                              :clearable="false"
                              :editable="false"
                            ></DatePicker>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="要求完成天数：" prop="timeLimit">
                            <Input class="bidding-item-input" v-model="editinfo.timeLimit" />
                          </FormItem>
                        </div>
                      </div>
                    </div>
                  </div>

                  <div class="panel panel-default bidding-title">
                    <div class="panel-heading">
                      <h4 class="panel-title">项目信息</h4>
                    </div>
                    <div class="panel-body">
                      <br />
                      <div>
                        <div class="bidding-item">
                          <FormItem label="项目名称：" prop="name">
                            <Input class="bidding-item-input" v-model="editinfo.name" />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="行业类别：" prop="industryType">
                            <Select
                              v-model="editinfo.industryType"
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in carerType"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>

                            <!-- <Input class="bidding-item-input" v-model="editinfo.industryType"/> -->
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="项目类别：" prop="type">
                            <Select
                              v-model="editinfo.type"
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in proType"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>

                            <!-- <Input class="bidding-item-input" v-model="editinfo.type"/> -->
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="合同日期：" prop="contractDate">
                            <DatePicker
                              type="date"
                              style="width:200px"
                              v-model="editinfo.contractDate"
                              format="yyyy-MM-dd"
                              :clearable="false"
                              :editable="false"
                            ></DatePicker>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="项目经费：" prop="fund">
                            <Input class="bidding-item-input" v-model="editinfo.fund" />
                            <p>万元</p>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="合同归属：" :label-width="97" prop="contractOrigin">
                            <Select
                              v-model="editinfo.contractOrigin"
                              clearable
                              style="width:150px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in contactOrgOption"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                            <!-- <Input class="bidding-item-input" v-model="editinfo.contractOrigin"/> -->
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="所属地区：" prop="province">
                            <Select
                              v-model="editinfo.province"
                              style="width:182px"
                              @on-change="choseProvince"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in province"
                                :value="item.value"
                                :key="item.id"
                              >{{ item.value }}</Option>
                            </Select>
                            <Select
                              v-model="editinfo.city"
                              style="width:182px"
                              @on-change="choseCity"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in shi1"
                                :value="item.value"
                                :key="item.id"
                              >{{ item.value }}</Option>
                            </Select>
                            <Select
                              v-model="editinfo.area"
                              style="width:182px"
                              @on-change="choseBlock"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in qu1"
                                :value="item.value"
                                :key="item.id"
                              >{{ item.value }}</Option>
                            </Select>
                            <!-- <Input class="bidding-item-input" v-model="editinfo.province"/> -->
                            <!-- <Input class="bidding-item-input" v-model="editinfo.city"/> -->
                            <!-- <Input class="bidding-item-input" v-model="editinfo.area"/> -->
                          </FormItem>
                        </div>
                      </div>
                    </div>
                  </div>

                  <div class="panel panel-default bidding-title">
                    <div class="panel-heading">
                      <h4 class="panel-title">建设单位信息</h4>
                    </div>
                    <div class="panel-body">
                      <br />
                      <div>
                        <div class="bidding-item">
                          <FormItem label="建设单位：" prop="developmentOrganization">
                            <Input
                              class="bidding-item-input"
                              v-model="editinfo.developmentOrganization"
                            />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="地址：" prop="address">
                            <Input class="bidding-item-input" v-model="editinfo.address" />
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="联系人：" prop="contact">
                            <Input class="bidding-item-input" v-model="editinfo.contact" />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="联系方式：" prop="contactPhone">
                            <Input class="bidding-item-input" v-model="editinfo.contactPhone" />
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="税号：" prop="taxNumber">
                            <Input class="bidding-item-input" v-model="editinfo.taxNumber" />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="开户银行：" prop="bankName">
                            <Input class="bidding-item-input" v-model="editinfo.bankName" />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="银行账号：" prop="bankAccount">
                            <Input class="bidding-item-input" v-model="editinfo.bankAccount" />
                          </FormItem>
                        </div>
                      </div>
                    </div>
                  </div>

                  <div class="panel panel-default bidding-title">
                    <div class="panel-heading">
                      <h4 class="panel-title">其他</h4>
                    </div>
                    <div class="panel-body">
                      <br />
                      <div>
                        <div class="bidding-item">
                          <FormItem label="备注：" prop="remark">
                            <Input v-model="editinfo.remark" type="textarea" style="width: 910px" />
                          </FormItem>
                        </div>
                      </div>
                    </div>
                  </div>

                  <div>
                    <Button type="primary" @click="submitundertakeedit('editForm')">确定</Button>
                    <Button @click="closeundertakeedit">取消</Button>
                  </div>
                </Form>
              </div>
            </div>
          </div>
        </div>
      </transition>

      <transition name="bidding-high">
        <div class="bidding-block" v-if="undertakeHigh">
          <Form ref="formHigh" :rules="ruleHigh" :model="equalConditions" :label-width="150">
            <div class="bidding-block-top">
              <div class="bidding-block-close" @click="cancelAdd">
                <!--左上角关闭动作-->
                <Icon type="md-close" />
              </div>
              <span>高级查询</span>
            </div>
            <div>
              <div class="bidding-body">
                <div class="bidding-content">
                  <div class="panel panel-default bidding-title">
                    <div class="panel-heading">
                      <h4 class="panel-title">范围</h4>
                    </div>
                    <div class="panel-body">
                      <br />
                      <div>
                        <div class="bidding-item">
                          <FormItem label="合同日期范围从：">
                            <DatePicker type="date" v-model="rangeConditions[0].sta" />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem :label-width="50">
                            <span>至</span>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem :label-width="50">
                            <DatePicker type="date" v-model="rangeConditions[0].end" />
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="收款日期范围从：">
                            <DatePicker type="date" v-model="rangeConditions[1].sta" />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem :label-width="50">
                            <span>至</span>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem :label-width="50">
                            <DatePicker type="date" v-model="rangeConditions[1].end" />
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="项目登记日期从：">
                            <DatePicker type="date" v-model="rangeConditions[2].sta" />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem :label-width="50">
                            <span>至</span>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem :label-width="50">
                            <DatePicker type="date" v-model="rangeConditions[2].end" />
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="发票日期范围从：">
                            <DatePicker type="date" v-model="rangeConditions[3].sta" />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem :label-width="50">
                            <span>至</span>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem :label-width="50">
                            <DatePicker type="date" v-model="rangeConditions[3].end" />
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="盖章日期范围从：">
                            <DatePicker type="date" v-model="rangeConditions[4].sta" />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem :label-width="50">
                            <span>至</span>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem :label-width="50">
                            <DatePicker type="date" v-model="rangeConditions[4].end" />
                          </FormItem>
                        </div>
                      </div>
                    </div>
                  </div>

                  <div class="panel panel-default bidding-title">
                    <div class="panel-heading">
                      <h4 class="panel-title">类别</h4>
                    </div>
                    <div class="panel-body">
                      <br />
                      <div>
                        <div class="bidding-item">
                          <FormItem label="项目类别：">
                            <Select
                              v-model="equalConditions.type"
                              clearable
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in proType"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                          </FormItem>
                        </div>

                        <div class="bidding-item">
                          <FormItem label="行业类别：">
                            <Select
                              v-model="equalConditions.industryType"
                              clearable
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in carerType"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="合同归属单位：">
                            <Select
                              v-model="equalConditions.contractOrigin"
                              clearable
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in contactOrgOption"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="所属地区：">
                            <Select
                              v-model="equalConditions.province"
                              style="width:200px"
                              @on-change="choseProvince"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in province"
                                :value="item.value"
                                :key="item.id"
                              >{{ item.value }}</Option>
                            </Select>
                            <!-- <Input class="bidding-item-input" v-model="equalConditions.province" /> -->
                          </FormItem>
                        </div>

                        <div class="bidding-item">
                          <FormItem>
                            <Select
                              v-model="equalConditions.city"
                              style="width:200px"
                              @on-change="choseCity"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in shi1"
                                :value="item.value"
                                :key="item.id"
                              >{{ item.value }}</Option>
                            </Select>
                            <!-- <Input class="bidding-item-input" v-model="equalConditions.city" /> -->
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem>
                            <Select
                              v-model="equalConditions.area"
                              style="width:200px"
                              @on-change="choseBlock"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in qu1"
                                :value="item.value"
                                :key="item.id"
                              >{{ item.value }}</Option>
                            </Select>
                            <!-- <Input class="bidding-item-input" v-model="equalConditions.area" /> -->
                          </FormItem>
                        </div>
                      </div>
                    </div>
                  </div>

                  <div class="panel panel-default bidding-title">
                    <div class="panel-heading">
                      <h4 class="panel-title">状态</h4>
                    </div>
                    <div class="panel-body">
                      <br />
                      <div>
                        <div class="bidding-item">
                          <FormItem label="项目状态：">
                            <Select
                              v-model="spState"
                              clearable
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in contactStateOption"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="归档状态：">
                            <Select
                              v-model="equalConditions.hasArchived"
                              clearable
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in backFileOption"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="收款状态：">
                            <Select
                              v-model="spCollect"
                              style="width:200px"
                              clearable
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in collecOption"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                          </FormItem>
                        </div>

                        <div class="bidding-item">
                          <FormItem label="盖章状态：">
                            <Select
                              v-model="equalConditions.hasUsualSealed"
                              clearable
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in sealOption"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="发票状态：">
                            <Select
                              v-model="spInvoice"
                              style="width:200px"
                              clearable
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in invoiceOption"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                          </FormItem>
                        </div>
                      </div>

                      <div>
                        <div class="bidding-item">
                          <FormItem label="奖金状态：">
                            <Select
                              v-model="spReward"
                              style="width:200px"
                              clearable
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in rewardOption"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                          </FormItem>
                        </div>

                        <div class="bidding-item">
                          <FormItem label="合同有无：">
                            <Select
                              v-model="equalConditions.hasContract"
                              clearable
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in ifContactOption"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="业务开支：">
                            <Select
                              v-model="spOutput"
                              style="width:200px"
                              clearable
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in outputOption"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                          </FormItem>
                        </div>
                      </div>
                    </div>
                  </div>

                  <div class="panel panel-default bidding-title">
                    <div class="panel-heading">
                      <h4 class="panel-title">其他</h4>
                    </div>
                    <div class="panel-body">
                      <br />
                      <div>
                        <div class="bidding-item">
                          <FormItem label="项目名称：" prop="name">
                            <Input
                              style="width:200px"
                              class="bidding-item-input"
                              v-model="equalConditions.name"
                            />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="任务单编号：" prop="taskNumber">
                            <Input
                              style="width:200px"
                              class="bidding-item-input"
                              v-model="equalConditions.taskNumber"
                            />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="建设单位：" prop="developmentOrganization">
                            <Input
                              class="bidding-item-input"
                              v-model="equalConditions.developmentOrganization"
                            />
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="编制人员：">
                            <Select
                              v-model="equalConditions.editPersonId"
                              clearable
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in editPerList"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="完成部门：">
                            <Select
                              v-model="equalConditions.finishDepartmentId"
                              clearable
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in dptList"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                          </FormItem>
                        </div>
                      </div>
                    </div>
                  </div>

                  <div>
                    <Button type="primary" @click="checkAdd('formHigh')">确定</Button>
                    <Button @click="cancelAdd">取消</Button>
                  </div>
                </div>
              </div>
            </div>
          </Form>
        </div>
      </transition>
    </div>
  </div>
</template>
<script>
import axios from "axios";
// import SelectTree from "../../components/treeSelect.vue";

export default {
  // components: {
  //   SelectTree
  // },
  data() {
    //不能为空 必填
    const validateDate = (rule, value, callback) => {
      if (value) {
        callback();
      } else {
        callback(new Error("日期不能为空"));
      }
    };

    //不含空格 非必填
    const validateSpace = (rule, value, callback) => {
      if (value) {
        const res = this.common.judgeSpachs(value);
        if (res === -1) {
          callback(new Error("不能含有空格"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    //数字+字母  非必填
    const validateLenNoLetter = (rule, value, callback) => {
      if (value) {
        const res = this.common.judgeNoLetter(value);
        if (res === -1) {
          callback(new Error("输入只能是数字和英文"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    //电话格式  非必填
    const validatePhone = (rule, value, callback) => {
      if (value) {
        const res = this.common.judgePhone(value);
        if (res === -1) {
          callback(new Error("号码填写不正确"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    //汉字+字母  非必填
    const validateLenCHLetter = (rule, value, callback) => {
      if (value) {
        const res = this.common.judgeInput(value);
        if (res === -1) {
          callback(new Error("输入只能是汉字和英文"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    //数字+汉字+字母  非必填
    const validateLenNoCHLetter = (rule, value, callback) => {
      if (value) {
        const res = this.common.judgeNumberInput(value);
        if (res === -1) {
          callback(new Error("输入只能是汉字、英文或数字符号"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };

    //只能为数字 必填
    const validateNo = (rule, value, callback) => {
      const res = this.common.judgeNo(value);
      if (res === -1) {
        callback(new Error("输入只能是数字"));
      } else {
        callback();
      }
    };

    //只能为数字和字母 必填
    const validateNoLetter = (rule, value, callback) => {
      const res = this.common.judgeNoLetter(value);
      if (res === -1) {
        callback(new Error("输入只能是数字或英文符号"));
      } else {
        callback();
      }
    };
    //判断输入只能为汉字英文  必填
    const validateChLetter = (rule, value, callback) => {
      const res = this.common.judgeInput(value);
      if (res === -1) {
        callback(new Error("输入只能是汉字或英文符号"));
      } else {
        callback();
      }
    };
    //只能为汉字英文或者数字 必填
    const validateChLetterNo = (rule, value, callback) => {
      const res = this.common.judgeNumberInput(value);
      if (res === -1) {
        callback(new Error("输入只能是汉字、英文或数字符号"));
      } else {
        callback();
      }
    };
    return {
      exportModel1: false,
      exportModel2: false,
      exportModel3: false,
      exportModel4: false,
      selectModel: null,
      row: {},
      pageNum: 1,
      pageSize: 10,
      modelId: 2,
      proEditPeo:[],

      totalDataNo: null, //总共的数据个数

      //处理权限disabled
      createBton: true,
      exportBton: true,
      easySearchBton: true,
      highWinButton: true,
      highSearchBton: true,
      jurisdiction: null, //当前用户的权限
      jurisdictionNo: null, //1标识只有承接，2表示只有管理，3表示都有

      //树型select********************************
      isClearable: true, // 可清空
      isAccordion: true, // 可收起
      valueId: 0, // 查询部门ID
      valueId2: 0,
      //第一个界面的查询*****************
      personName: [{ id: 0, name: "全部" }], //承接人员数组
      model1: 0, //承接人员ID
      dataTree: [], //部门树
      perNo: 0, //在拿人员的时候定义的一共的页数
      yearName: [], //年份数组
      model2: 0, //年份ID
      nowyear: {}, //当前年

      select1: null,
      select2: null,
      select3: null,

      props: {
        // 配置项（必选）
        value: "id",
        label: "name",
        children: "children"
        // disabled:true
      },

      newinfo: {
        undertakeDepartmentId: null, //承接部门id
        undertakePersonId: null, //承接人id
        taskNumber: null, //任务单编号
        finishDepartmentId: null, //完成部门id
        editPersonId: null, //编制人员id
        registDate: null, //登记日期
        name: null, //项目名称
        industryType: null, //行业类别
        type: null, //项目类别
        contractDate: null, //合同日期
        startDate: null, //任务下达日期
        timeLimit: null, //要求完成天数
        developmentOrganization: null, //建设单位
        province: null, //省
        city: null, //市
        area: null, //区
        address: null, //地址
        contact: null, //联系人
        contactPhone: null, //联系方式
        taxNumber: null, //税号
        bankName: null, //开户银行
        bankAccount: null, //银行账号
        fund: null, //项目经费
        contractOrigin: null, //合同归属
        remark: null //备注
        //共25个
      },
      submitCreateinfo: {
        undertakeDepartmentId: null, //承接部门id
        undertakePersonId: null, //承接人id
        taskNumber: null, //任务单编号
        finishDepartmentId: null, //完成部门id
        editPersonId: null, //编制人员id
        registDate: null, //登记日期
        name: null, //项目名称
        industryType: null, //行业类别
        type: null, //项目类别
        contractDate: null, //合同日期
        startDate: null, //任务下达日期
        timeLimit: null, //要求完成天数
        developmentOrganization: null, //建设单位
        province: null, //省
        city: null, //市
        area: null, //区
        address: null, //地址
        contact: null, //联系人
        contactPhone: null, //联系方式
        taxNumber: null, //税号
        bankName: null, //开户银行
        bankAccount: null, //银行账号
        fund: null, //项目经费
        contractOrigin: null, //合同归属
        remark: null //备注
        //共25个
      },
      editinfo: {
        undertake_departmentId: null, //承接部门id//
        undertakePersonId: null, //承接人id//
        taskNumber: null, //任务单编号//
        finishDepartmentId: null, //完成部门id//
        editPersonId: null, //编制人员id //
        registDate: null, //登记日期//
        name: null, //项目名称//
        industryType: null, //行业类别//
        type: null, //项目类别//
        contractDate: null, //合同日期//
        startDate: null, //任务下达日期//
        timeLimit: null, //要求完成天数//
        developmentOrganization: null, //建设单位//
        province: null, //省//
        city: null, //市//
        area: null, //区//
        address: null, //地址//
        contact: null, //联系人//
        contactPhone: null, //联系方式//
        taxNumber: null, //税号//
        bankName: null, //开户银行//
        bankAccount: null, //银行账号//
        fund: null, //项目经费//
        contractOrigin: null, //合同归属//
        remark: null, //备注//
        //共25个
        isBidProject: null, //是否为招投标//
        projectId: null //项目id//
      },
      submiteditinfo: {
        undertakeDepartmentId: null, //承接部门id//
        undertakePersonId: null, //承接人id//
        taskNumber: null, //任务单编号//
        finishDepartmentId: null, //完成部门id//
        editPersonId: null, //编制人员id //
        registDate: null, //登记日期//
        name: null, //项目名称//
        industryType: null, //行业类别//
        type: null, //项目类别//
        contractDate: null, //合同日期//
        startDate: null, //任务下达日期//
        timeLimit: null, //要求完成天数//
        developmentOrganization: null, //建设单位//
        province: null, //省//
        city: null, //市//
        area: null, //区//
        address: null, //地址//
        contact: null, //联系人//
        contactPhone: null, //联系方式//
        taxNumber: null, //税号//
        bankName: null, //开户银行//
        bankAccount: null, //银行账号//
        fund: null, //项目经费//
        contractOrigin: null, //合同归属//
        remark: null, //备注//
        //共25个

        projectId: null //项目id//
      },
      editcontractDate: null, //合同日期//
      editstartDate: null, //任务下达日期//
      ruleHigh: {
        developmentOrganization: [
          //建设单位 数+英+汉
          { required: false, validator: validateLenNoCHLetter, trigger: "blur" }
        ],
        name: [
          //项目名称
          { required: false, validator: validateLenNoCHLetter, trigger: "blur" }
        ],
        taskNumber: [
          { required: false, validator: validateSpace, trigger: "blur" }
        ]
      },
      ruleCreate: {
        bankAccount: [
          //银行账号  数+字母 非必填
          { required: false, validator: validateLenNoLetter, trigger: "blur" }
        ],
        bankName: [
          //开户银行  英+汉 非必填
          { required: false, validator: validateLenCHLetter, trigger: "blur" }
        ],
        taxNumber: [
          //税号 数+字母  非必填
          { required: false, validator: validateLenNoLetter, trigger: "blur" }
        ],
        contactPhone: [
          //联系方式  非必填
          { required: false, validator: validatePhone, trigger: "blur" }
        ],
        contact: [
          //联系人 英+汉 非必填
          { required: false, validator: validateLenCHLetter, trigger: "blur" }
        ],
        address: [
          //地址 数+英+汉 非必填
          { required: false, validator: validateLenNoCHLetter, trigger: "blur" }
        ],
        undertakeDepartmentId: [
          { required: true, message: "不能为空", trigger: "blur" }
        ],
        undertakePersonId: [
          { required: true, message: "不能为空", trigger: "blur" }
        ],
        taskNumber: [{ required: true, message: "不能为空", trigger: "blur" }],
        finishDepartmentId: [
          { required: true, message: "不能为空", trigger: "blur" }
        ],
        editPersonId: [
          { required: true, message: "不能为空", trigger: "blur" }
        ],
        registDate: [{ required: true, message: "不能为空", trigger: "blur" }],
        name: [
          { required: true, message: "不能为空", trigger: "blur" },
          { required: true, validator: validateChLetterNo, trigger: "blur" }
        ],
        industryType: [
          { required: true, message: "不能为空", trigger: "blur" }
        ],
        type: [{ required: true, message: "不能为空", trigger: "blur" }],
        contractDate: [
          {
            required: true,
            type: "date",
            message: "不能为空",
            trigger: "change"
          }
        ],
        startDate: [
          {
            required: true,
            type: "date",
            message: "不能为空",
            trigger: "change"
          }
        ],
        timeLimit: [
          { required: true, message: "不能为空", trigger: "blur" },
          {
            type: "number",
            message: "输入的类型为数字",
            transform(value) {
              return Number(value);
            }
          }
        ],
        developmentOrganization: [
          //建设单位  数+英+汉
          { required: true, message: "不能为空", trigger: "blur" },
          { required: true, validator: validateChLetterNo, trigger: "blur" }
        ],
        province: [{ required: true, message: "不能为空", trigger: "blur" }],
        fund: [
          { required: true, message: "不能为空", trigger: "blur" },
          {
            type: "number",
            message: "输入的类型为数字",
            transform(value) {
              return Number(value);
            }
          }
        ],
        contractOrigin: [
          { required: true, message: "不能为空", trigger: "blur" }
        ]
      },

      ruleEdit: {
        bankAccount: [
          //银行账号  数+字母 非必填
          { required: false, validator: validateLenNoLetter, trigger: "blur" }
        ],
        bankName: [
          //开户银行  英+汉 非必填
          { required: false, validator: validateLenCHLetter, trigger: "blur" }
        ],
        taxNumber: [
          //税号 数+字母  非必填
          { required: false, validator: validateLenNoLetter, trigger: "blur" }
        ],
        contactPhone: [
          //联系方式  非必填
          { required: false, validator: validatePhone, trigger: "blur" }
        ],
        contact: [
          //联系人 英+汉 非必填
          { required: false, validator: validateLenCHLetter, trigger: "blur" }
        ],
        address: [
          //地址 数+英+汉 非必填
          { required: false, validator: validateLenNoCHLetter, trigger: "blur" }
        ],

        taskNumber: [{ required: true, message: "不能为空", trigger: "blur" }],
        finishDepartmentId: [
          { required: true, message: "不能为空", trigger: "blur" }
        ],
        editPersonId: [
          { required: true, message: "不能为空", trigger: "blur" }
        ],
        registDate: [{ required: true, message: "不能为空", trigger: "blur" }],
        name: [
          { required: true, message: "不能为空", trigger: "blur" },
          { required: true, validator: validateChLetterNo, trigger: "blur" }
        ],
        industryType: [
          { required: true, message: "不能为空", trigger: "blur" }
        ],
        type: [{ required: true, message: "不能为空", trigger: "blur" }],
        contractDate: [
          {
            required: true,
            validator: validateDate,
            trigger: "blur"
          }
        ],
        startDate: [
          {
            required: true,
            validator: validateDate,
            trigger: "blur"
          }
        ],
        timeLimit: [
          { required: true, message: "不能为空", trigger: "blur" },
          { required: true, validator: validateNo, trigger: "blur" }
        ],
        developmentOrganization: [
          //建设单位  数+英+汉
          { required: true, message: "不能为空", trigger: "blur" },
          { required: true, validator: validateChLetterNo, trigger: "blur" }
        ],
        province: [{ required: true, message: "不能为空", trigger: "blur" }],
        fund: [
          { required: true, message: "不能为空", trigger: "blur" },
          { required: true, validator: validateNo, trigger: "blur" }
        ],
        contractOrigin: [
          { required: true, message: "不能为空", trigger: "blur" }
        ]
      },

      abandonModal: false, //放弃项目
      undertakeDtailedit: false,
      undertakeDtaildetail: false,
      undertakeCreate: false,
      undertakenews: "项目基本信息",
      type: false,
      which: "easynews",
      callbackdata: {}, //返回数据
      columns: [
        {
          type: "selection",
          width: 60,
          align: "center",
          fixed: "left",
          title: "选择",
          key: "choice"
        },
        {
          title: "序号",
          width: 100,
          key: "id",
          fixed: "left"
        },
        // {
        //   title: "状态",
        //   width: 120,
        //   key: "state"
        // },
        // {
        //   title: "是否废弃",
        //   width: 120,
        //   key: "ifabandon",
        //   fixed: "right",
        //   render: (h, params) => {
        //     let st = params.row.state;

        //     if (st > 127) {
        //       return h("Dropdown", [
        //         h("Button", { props: { type: "error" } }, "废")
        //       ]);
        //     }
        //   }
        // },
        {
          title: "操作",
          fixed: "right",
          key: "number",
          width: 120,
          render: (h, params) => {
            let st = params.row.state;
            let detailBton = true;
            let editBton = true;
            let abandonBton = true;
            if (this.jurisdictionNo >= 1) {
              detailBton = false;
            }
            if (this.jurisdictionNo == 1 || this.jurisdictionNo == 3) {
              editBton = false;
            }
            if (st >= 63) {
              if (this.jurisdictionNo == 2 || this.jurisdictionNo == 3) {
                abandonBton = false;
              }
            } else {
              if (this.jurisdictionNo >=1) {
                abandonBton = false;
              }
            }
            if (st > 127) {
              return h("Badge", { props: { text: "废", offset: [13, 0] } }, [
                h(
                  "Dropdown",
                  {
                    on: {
                      "on-click": name => {
                        let rowData = params.row;
                        let id = rowData.id;
                        let st = params.row.state;
                        if (name == "read") {
                          this.undertakeDtaildetail = true;
                          this.row = id;
                          this.setBackdata(st);
                        } else if (name == "edit") {
                          this.row = id;
                          this.geteditInfo();
                          this.undertakeDtailedit = true;
                        } else if (name == "abandon") {
                          //放弃项目
                          this.row = id;
                          this.abandonModal = true;
                        }
                      }
                    },
                    props: {
                      transfer: true
                    }
                  },
                  [
                    h(
                      "Button",
                      {
                        props: {
                          type: "primary"
                        }
                      },
                      "操作>>"
                    ),
                    h(
                      "DropdownMenu",
                      {
                        slot: "list"
                      },
                      [
                        h(
                          "DropdownItem",
                          {
                            props: {
                              name: "read",
                              disabled: detailBton
                            }
                          },
                          "查看详情"
                        ),
                        h(
                          "DropdownItem",
                          {
                            props: {
                              name: "edit",
                              disabled: editBton
                            }
                          },
                          "修改承接信息"
                        ),
                        h(
                          "DropdownItem",
                          {
                            props: {
                              name: "abandon",
                              disabled: abandonBton
                            }
                          },
                          "项目作废"
                        )
                      ]
                    )
                  ]
                )
              ]);
            } else {
              return h(
                "Dropdown",
                {
                  on: {
                    "on-click": name => {
                      let rowData = params.row;
                      let id = rowData.id;
                      let st = params.row.state;
                      if (name == "read") {
                        this.undertakeDtaildetail = true;
                        this.row = id;
                        this.setBackdata(st);
                      } else if (name == "edit") {
                        this.row = id;
                        this.geteditInfo();
                        this.undertakeDtailedit = true;
                      } else if (name == "abandon") {
                        //放弃项目
                        this.row = id;
                        this.abandonModal = true;
                      }
                    }
                  },
                  props: {
                    transfer: true
                  }
                },
                [
                  h(
                    "Button",
                    {
                      props: {
                        type: "primary"
                      }
                    },
                    "操作>>"
                  ),
                  h(
                    "DropdownMenu",
                    {
                      slot: "list"
                    },
                    [
                      h(
                        "DropdownItem",
                        {
                          props: {
                            name: "read",
                            disabled: detailBton
                          }
                        },
                        "查看详情"
                      ),
                      h(
                        "DropdownItem",
                        {
                          props: {
                            name: "edit",
                            disabled: editBton
                          }
                        },
                        "修改承接信息"
                      ),
                      h(
                        "DropdownItem",
                        {
                          props: {
                            name: "abandon",
                            disabled: abandonBton
                          }
                        },
                        "项目作废"
                      )
                    ]
                  )
                ]
              );
            }

            //return h末尾
          } //render末尾
        } //操作末尾
      ], //columns末尾
      ////////////////////////////////////////////////////////////
      clearHigh: false,
      undertakeHigh: false,

      equalConditions: {
        //单个字段list
        developmentOrganization: null, //建设单位
        //state: null, //项目状态
        hasArchived: null, //归档状态
        editPersonId: null, //编制人id
        finishDepartmentId: null, //完成部门id

        name: null, //项目名称
        taskNumber: null, //任务单编号
        province: null,
        city: null,
        area: null,
        type: null, //项目类别
        industryType: null, //行业类别
        contractOrigin: null, //合同归属单位
        hasUsualSealed: null, //盖章状态
        hasContract: null, //合同有无
        businessFeeTag: null //业务开支有无
        //共16个
      },
      rangeConditions: [
        //传给后端的时间，或金额字段
        {
          field: "contractDate",
          sta: null,
          end: null
        },
        {
          field: "collectionDate",
          sta: null,
          end: null
        },
        {
          field: "registDate",
          sta: null,
          end: null
        },
        {
          field: "invoiceDate",
          sta: null,
          end: null
        },
        {
          field: "usualSealDate",
          sta: null,
          end: null
        }
      ],
      specialConditions: [], //传给后端的特殊字段

      spCollect: null, //特殊收款状态v-model
      spInvoice: null, //特殊发票状态v-model
      spReward: null, //特殊奖金状态v-model
      spOutput: null, //特殊业务开支v-model，0或1直接赋值到list，2添加到特殊
      spState: null, //特殊合同状态v-model

      contactOrgOption: [
        //合同归属
        {
          id: "学校",
          name: "学校"
        },
        {
          id: "公司",
          name: "公司"
        }
      ],
      collecOption: [
        //收款状态
        {
          id: "collectionAmount=0",
          name: "尚无收款"
        },
        {
          id: "collectionAmount=fund",
          name: "已收款"
        },
        {
          id: "collectionAmount>0 and collectionAmount<fund",
          name: "部分收款"
        },
        {
          id: "collectionAmount=0 or collectionAmount<fund",
          name: "尚无收款及部分收款"
        },
        {
          id: "collectionAmount>0",
          name: "已收款及部分收款"
        }
      ],
      sealOption: [
        //盖章状态
        {
          id: 0,
          name: "未盖章"
        },
        {
          id: 1,
          name: "已盖章"
        }
      ],
      invoiceOption: [
        //发票状态
        {
          id: "invoiceAmount=0",
          name: "发票未开"
        },

        {
          id: "invoiceAmount>0 and invoiceAmount<fund",
          name: "发票部分开"
        },
        {
          id: "invoiceAmount>0 and invoiceAmount<=fund",
          name: "发票已开+部分开"
        },
        {
          id: "invoiceAmount=0 or (invoiceAmount > 0 and invoiceAmount<fund)",
          name: "发票未开+部分开"
        },
        {
          id: "invoiceAmount=fund and invoiceAmount!=0",
          name: "发票已开"
        }
      ],
      rewardOption: [
        //奖金状态
        {
          id: "rewardAmount=0",
          name: "尚无奖金"
        },
        {
          id: "rewardAmount=collectionAmount and rewardAmount!=0",
          name: "奖金等于收款"
        },
        {
          id: "rewardAmount>collectionAmount",
          name: "奖金多于收款"
        },
        {
          id: "rewardAmount<collectionAmount",
          name: "奖金少于收款"
        },
        {
          id: "rewardAmount<collectionAmount or rewardAmount=0",
          name: "尚无奖金且奖金少于收款"
        }
      ],
      ifContactOption: [
        //合同有无
        {
          id: 0,
          name: "无合同"
        },
        {
          id: 1,
          name: "有合同"
        }
      ],
      outputOption: [
        //业务开支
        {
          id: 0,
          name: "无"
        },
        {
          id: 1,
          name: "有"
        },
        {
          id: 2,
          name: "未处理"
        }
      ],
      contactStateOption: [
        //项目状态
        {
          id: "(state>>7)&1=0",
          name: "正常"
        },
        {
          id: "(state>>7)&1=1",
          name: "废弃"
        }
      ],
      backFileOption: [
        //归档状态
        {
          id: 1,
          name: "已归档"
        },
        {
          id: 0,
          name: "未归档"
        }
      ],

      data: [],
      userName: null,
      userDepment: null,
      userID: null,
      userDepmentID: null,
      nowDate: null,

      callbackState: {},

      proType: [], //项目类别名单
      editPeo: [], //项目编制人员名单
      dptList: [], //所有部门列表
      carerType: [], //所有行业类别
      allPeo: [], //所有人的名单
      allPeoPages: null,
      editPerList: [], //编制权限人名单
      selectId: [], //选择的项目数据
      ids: [],
      keyword: null,
      undertakeDPListName: null,
      undertakePRListName: null,
      regDate: null,
      rangeTag: null, //是否是全院
      totalHigh: null, //全院个数
      mapJson: this.IP.IP + "/map.json",
      province: "",
      sheng: "",
      shi: "",
      shi1: [],
      qu: "",
      qu1: [],
      city: "",
      block: "",
      corse1: {
        label: null
      },
      corse2: {
        label: null
      },
      corse3: {
        label: null
      }
    };
  },
  beforeMount() {
    this.getNewData();
    this.getcolumns(); //产生表头
    this.getdepartments(); //得到部门的name和ID
    this.getAllPeo(); //得到所有人
    this.getNowYear();
    this.getUserInfo();
    this.getproType();
    this.geteditPeo();
    this.getCarerType();
    this.getEditpersonList();
    this.getAllHighSearch();
    this.getCityData();
    this.getJurisdiction(); //获得当前用户的权限
    //console.log(this.valueId);
    //console.log(this.model1);
    //console.log(this.model2);
    //console.log(this.totalDataNo);
  },

  methods: {
    backoutExport() {
      this.exportModel1 = false;
      this.exportModel2 = false;
      this.exportModel3 = false;
      this.exportModel4 = false;
      // this.openExportMdel = null;
    },
    comfirmExport1() {
      this.exportModel1 = false;
      this.exportList();
    },
    comfirmExport2() {
      this.exportModel2 = false;

      this.exportAccount();
    },
    comfirmExport3() {
      this.exportModel3 = false;

      this.exportTotal();
    },
    comfirmExport4() {
      this.exportModel4 = false;
      this.exportType();
    },
    openExportMdel1() {
      this.exportModel1=true;
    },
    openExportMdel2() {
      this.exportModel2=true;
    },
    openExportMdel3() {
      this.exportModel3=true;
    },
    openExportMdel4() {
      this.exportModel4=true;
    },
    getJurisdiction() {
      axios({
        method: "get",
        url: this.IP.IP + "/personInfo/getPermission"
      }).then(result => {
        this.jurisdiction = result.data.data;
        // console.log("权限", this.jurisdiction);
        var i = 0;
        var judge1 = 0;
        var judge2 = 0;
        for (i; i < this.jurisdiction.length; i++) {
          if (this.jurisdiction[i] == "承接") {
            judge1 = 1;
          }
          if (this.jurisdiction[i] == "管理") {
            judge2 = 1;
          }
        }
        if (judge1 == 1 && judge2 == 1) {
          this.jurisdictionNo = 3;
        } else if (judge1 != 1 && judge2 == 1) {
          this.jurisdictionNo = 2;
        } else if (judge1 == 1 && judge2 != 1) {
          this.jurisdictionNo = 1;
        } else {
          this.jurisdictionNo = -1;
        }
        // console.log("数字权限", this.jurisdictionNo);
        this.handleJurisdiction();
      });
    },
    //处理操作的disabled
    handleJurisdiction() {
      if (this.jurisdictionNo == 1 || this.jurisdictionNo == 3) {
        this.createBton = false;
      } else {
        this.createBton = true;
      }
      if (this.jurisdictionNo >= 1) {
        this.exportBton = false;
        this.easySearchBton = false;
        this.highWinButton = false;
        this.highSearchBton = false;
      } else {
        this.exportBton = true;
        this.easySearchBton = true;
        this.highWinButton = true;
        this.highSearchBton = true;
      }
    },
    insertPeo() {
      // console.info("insetr");
      //console.log(this.allPeoPages);
      var i = 1;
      for (i = 1; i <= this.allPeoPages; i++) {
        axios({
          method: "get",
          url: this.IP.IP + "/personInfo/show?pageNum=" + i + "&pageSize=" + 10
        }).then(result => {
          var total = result.data.data.list.length;
          var list = result.data.data.list;
          // console.info("lentgh");
          // console.info(total);
          //console.log(list);
          for (var j = 0; j < total; j++) {
            this.allPeo.push({
              id: list[j].id + "",
              name: list[j].name + ""
            });
            // console.info(i);
            // //console.log(this.allPeo);
          }
        });
      }
      // console.info("所有人名单");
      //console.log(this.allPeo);
    },
    getAllPeo() {
      axios({
        method: "get",
        url: this.IP.IP + "/personInfo/show?pageNum=" + 1 + "&pageSize=" + 10
      }).then(result => {
        this.allPeoPages = result.data.data.pages;
        // console.info("pages111");
        //console.log(this.allPeoPages);
        this.insertPeo();
      });
      //this.insertPeo();
    },
    // 选省
    choseProvince: function(e) {
      //console.log("111");
      //console.log(e);
      for (var index2 in this.province) {
        if (e.label === this.province[index2].value) {
          this.shi1 = this.province[index2].children;
          this.shi = this.province[index2].children[0].value;
          this.qu1 = this.province[index2].children[0].children;
          this.qu = this.province[index2].children[0].children[0].value;
          this.E = this.qu1[0].id;
        }
      }
    },
    // 选市
    choseCity: function(e) {
      for (var index3 in this.city) {
        if (e.label === this.city[index3].value) {
          this.qu1 = this.city[index3].children;
          this.qu = this.city[index3].children[0].value;
          this.E = this.qu1[0].id;
          // //console.log(this.E)
        }
      }
    },
    // 选区
    choseBlock: function(e) {
      this.E = e.label;
      // //console.log(this.E)
    },
    getCityData: function() {
      var that = this;
      axios
        .get(this.mapJson)
        .then(function(response) {
          if (response.status == 200) {
            var data = response.data;
            that.province = [];
            that.city = [];
            that.block = [];
            // 省市区数据分类
            for (var item in data) {
              if (item.match(/0000$/)) {
                //省
                that.province.push({
                  id: item,
                  value: data[item],
                  children: []
                });
              } else if (item.match(/00$/)) {
                //市
                that.city.push({ id: item, value: data[item], children: [] });
              } else {
                //区
                that.block.push({ id: item, value: data[item] });
              }
            }
            // 分类市级
            for (var index in that.province) {
              for (var index1 in that.city) {
                if (
                  that.province[index].id.slice(0, 2) ===
                  that.city[index1].id.slice(0, 2)
                ) {
                  that.province[index].children.push(that.city[index1]);
                }
              }
            }
            // 分类区级
            for (var item1 in that.city) {
              for (var item2 in that.block) {
                if (
                  that.block[item2].id.slice(0, 4) ===
                  that.city[item1].id.slice(0, 4)
                ) {
                  that.city[item1].children.push(that.block[item2]);
                }
              }
            }
            // console.info("sheng");
            //console.log(that.province);
            //console.log(that.city);
            //console.log(that.block);
          } else {
            //console.log(response.status);
          }
        })
        .catch(function(error) {
          //console.log(typeof +error);
        });
    },
    downloadType(data) {
      if (!data) {
        return;
      }
      var blob = new Blob([data], {
        type:
          "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"
      });
      var url = window.URL.createObjectURL(data.data);
      var aLink = document.createElement("a");
      aLink.style.display = "none";
      aLink.href = url;
      aLink.setAttribute("download", "projectRegType.xls");
      document.body.appendChild(aLink);
      aLink.click();
      document.body.removeChild(aLink); //下载完成移除元素
      window.URL.revokeObjectURL(url);
    },
    realExportType() {
      // console.info("ids");
      //console.log(this.ids);
      axios({
        method: "post",
        url: this.IP.IP + "/manage/exportTypeSummary",
        data: {
          ids: this.ids,
          time: this.regDate,
          undertakeName: this.undertakeDPListName
        },
        responseType: "blob"
      })
        .then(result => {
          // console.info("zong");
          //console.log(result);
          this.downloadType(result);
          this.ids = [];
          this.undertakeDPListName = null;
          this.undertakePRListName = null;
          this.regDate = null;
          this.selectId = [];
          this.$Spin.hide();
        })
        .catch(error => {});
    },
    exportType() {
      this.$Spin.show({
        render: h => {
          return h("div", [
            h("Icon", {
              class: "demo-spin-icon-load",
              props: {
                type: "ios-loading",
                size: 18
              }
            }),
            h("div", "Loading")
          ]);
        }
      });
      if (this.selectId.length > 0) {
        var i = 0;
        for (i = 0; i < this.selectId.length; i++) {
          this.ids.push(this.selectId[i].id);
        }
        // console.info("1");
        //console.log(this.ids);
        this.setTreeCondition();
        this.realExportType();
      } else {
        this.$ajax({
          method: "post",
          url: this.IP.IP + "/table/superSearchIds",
          data: {
            equalConditions: this.equalConditions,
            rangeConditions: this.rangeConditions,
            specialConditions: this.specialConditions
            //keyWord:this.keyword
          }
        }).then(result => {
          // console.info("2");
          //console.log(result.data.data)
          this.ids = result.data.data;
          this.setTreeCondition();
          this.realExportType();
        });
      }
    },
    realExportTotal() {
      // console.info("ids");
      //console.log(this.ids);
      //console.log(this.rangeTag);
      //console.log(this.undertakeDPListName);
      axios({
        method: "post",
        url: this.IP.IP + "/manage/exportSummary",
        data: {
          ids: this.ids,
          time: this.regDate,
          DepartmentName: this.undertakeDPListName,
          rangeTag: this.rangeTag
        },
        responseType: "blob"
      })
        .then(result => {
          // console.info("zong");
          //console.log(result);
          this.downloadTotal(result);
          this.ids = [];
          this.undertakeDPListName = null;
          this.undertakePRListName = null;
          this.regDate = null;
          this.selectId = [];
          this.rangeTag = null;
          this.$Spin.hide();
        })
        .catch(error => {});
    },
    downloadTotal(data) {
      if (!data) {
        return;
      }
      var blob = new Blob([data], {
        type:
          "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"
      });
      var url = window.URL.createObjectURL(data.data);
      var aLink = document.createElement("a");
      aLink.style.display = "none";
      aLink.href = url;
      aLink.setAttribute("download", "projectRegTotal.xls");
      document.body.appendChild(aLink);
      aLink.click();
      document.body.removeChild(aLink); //下载完成移除元素
      window.URL.revokeObjectURL(url);
    },
    exportTotal() {
      this.$Spin.show({
        render: h => {
          return h("div", [
            h("Icon", {
              class: "demo-spin-icon-load",
              props: {
                type: "ios-loading",
                size: 18
              }
            }),
            h("div", "Loading")
          ]);
        }
      });
      if (this.selectId.length > 0) {
        var i = 0;
        for (i = 0; i < this.selectId.length; i++) {
          this.ids.push(this.selectId[i].id);
        }
        // console.info("1");
        //console.log(this.ids);
        this.rangeTag = -1;
        this.setTreeCondition1();
        //this.realExportTotal();
      } else if (this.valueId != 0) {
        this.$ajax({
          method: "post",
          url: this.IP.IP + "/table/superSearchIds",
          data: {
            equalConditions: { undertakeDepartmentId: this.valueId }
          }
        }).then(result => {
          // console.info("5");
          //console.log(result.data.data)
          this.ids = result.data.data;
          this.setTreeCondition1();
          //this.realExportTotal();
        });
      } else {
        this.$ajax({
          method: "post",
          url: this.IP.IP + "/table/superSearchIds",
          data: {
            equalConditions: this.equalConditions,
            rangeConditions: this.rangeConditions,
            specialConditions: this.specialConditions
            //keyWord:this.keyword
          }
        }).then(result => {
          // console.info("2");
          //console.log(result.data.data)
          this.ids = result.data.data;
          this.rangeTag = -1;
          this.setTreeCondition1();
          //this.realExportTotal();
        });
      }
    },
    realExportAccount() {
      // console.info("ids");
      //console.log(this.ids);
      axios({
        method: "post",
        url: this.IP.IP + "//undertake/exportSettlement",
        data: {
          ids: this.ids,
          time: this.regDate,
          undertakeDepartmentName: this.undertakeDPListName,
          undertakePersonName: this.undertakePRListName
        },
        responseType: "blob"
      })
        .then(result => {
          // console.info("zong");
          //console.log(result);
          this.downloadAccount(result);
          this.ids = [];
          this.undertakeDPListName = null;
          this.undertakePRListName = null;
          this.regDate = null;
          this.selectId = [];
          this.$Spin.hide();
        })
        .catch(error => {});
    },
    downloadAccount(data) {
      if (!data) {
        return;
      }
      var blob = new Blob([data], {
        type:
          "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"
      });
      var url = window.URL.createObjectURL(data.data);
      var aLink = document.createElement("a");
      aLink.style.display = "none";
      aLink.href = url;
      aLink.setAttribute("download", "projectSettles.xls");
      document.body.appendChild(aLink);
      aLink.click();
      document.body.removeChild(aLink); //下载完成移除元素
      window.URL.revokeObjectURL(url);
    },
    exportAccount() {
      this.$Spin.show({
        render: h => {
          return h("div", [
            h("Icon", {
              class: "demo-spin-icon-load",
              props: {
                type: "ios-loading",
                size: 18
              }
            }),
            h("div", "Loading")
          ]);
        }
      });
      if (this.selectId.length > 0) {
        var i = 0;
        for (i = 0; i < this.selectId.length; i++) {
          this.ids.push(this.selectId[i].id);
        }
        // console.info("1");
        //console.log(this.ids);
        this.setTreeCondition();
        this.realExportAccount();
      } else {
        this.$ajax({
          method: "post",
          url: this.IP.IP + "/table/superSearchIds",
          data: {
            equalConditions: this.equalConditions,
            rangeConditions: this.rangeConditions,
            specialConditions: this.specialConditions
            //keyWord:this.keyword
          }
        }).then(result => {
          // console.info("2");
          //console.log(result.data.data)
          this.ids = result.data.data;
          this.setTreeCondition();
          this.realExportAccount();
        });
      }

      // axios({
      //   method: "post",
      //   url:
      //     this.IP.IP+"/undertake/exportSettlement",
      //   data:{
      //     ids:list
      //   },
      //   responseType: 'blob',

      // }).then(result => {
      //   console.info("zong");
      //   //console.log(result);
      //   this.download(result);
      // }).catch((error) => {
      //   //console.log(error);
      // })
    },

    download(data) {
      if (!data) {
        return;
      }
      var blob = new Blob([data], {
        type:
          "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"
      });
      var url = window.URL.createObjectURL(data.data);
      var aLink = document.createElement("a");
      aLink.style.display = "none";
      aLink.href = url;
      aLink.setAttribute("download", "2222.xls");
      document.body.appendChild(aLink);
      aLink.click();
      document.body.removeChild(aLink); //下载完成移除元素
      window.URL.revokeObjectURL(url);
    },
    exportList() {
      this.$Spin.show({
        render: h => {
          return h("div", [
            h("Icon", {
              class: "demo-spin-icon-load",
              props: {
                type: "ios-loading",
                size: 18
              }
            }),
            h("div", "Loading")
          ]);
        }
      });
      if (this.selectId.length > 0) {
        var i = 0;
        for (i = 0; i < this.selectId.length; i++) {
          this.ids.push(this.selectId[i].id);
        }
        // console.info("1");
        //console.log(this.ids);
        this.setTreeCondition();
        this.realExportList();
      } else {
        this.$ajax({
          method: "post",
          url: this.IP.IP + "/table/superSearchIds",
          data: {
            equalConditions: this.equalConditions,
            rangeConditions: this.rangeConditions,
            specialConditions: this.specialConditions
            //keyWord:this.keyword
          }
        }).then(result => {
          // console.info("2");
          //console.log(result.data.data)
          this.ids = result.data.data;
          this.setTreeCondition();
          this.realExportList();
        });
      }
    },
    setTreeCondition() {
      //console.log("验证部门id"+this.valueId);
      if (this.valueId != 0) {
        axios({
          method: "get",
          url:
            this.IP.IP + "/searchForDepartmentById?departmentId=" + this.valueId
        }).then(result => {
          // console.info("打印部门名字");
          //console.log(result);
          this.undertakeDPListName = result.data.data.name;
          //console.log(this.undertakeDPListName+"111222");
        });
      } else {
        this.undertakeDPListName = "全部";
        this.undertakePRListName = "全部";
      }
      if (this.rangeConditions[2].sta) {
        this.regDate = this.rangeConditions[2].sta;
      } else if (!this.rangeConditions[2].end) {
        this.regDate = "全部";
      }
      if (this.rangeConditions[2].end) {
        this.regDate = this.regDate + "至" + this.rangeConditions[2].end;
      }
    },
    setTreeCondition1() {
      //console.log("验证部门id"+this.valueId);
      if (this.rangeConditions[2].sta) {
        this.regDate = this.rangeConditions[2].sta;
      } else if (!this.rangeConditions[2].end) {
        this.regDate = "全部";
      }
      if (this.rangeConditions[2].end) {
        this.regDate = this.regDate + "至" + this.rangeConditions[2].end;
      }
      if (this.undertakeDPListName) {
        this.rangeTag = this.valueId;
      }
      if (this.valueId != 0) {
        axios({
          method: "get",
          url:
            this.IP.IP + "/searchForDepartmentById?departmentId=" + this.valueId
        }).then(result => {
          // console.info("打印部门名字");
          //console.log(result);
          this.undertakeDPListName = result.data.data.name;
          //console.log(this.undertakeDPListName+"111222");
          this.realExportTotal();
        });
      } else {
        this.rangeTag = -1;
        this.realExportTotal();
      }
    },
    searchByUnderDP() {
      this.$ajax({
        method: "post",
        url: this.IP.IP + "/table/superSearchIds",
        data: {
          equalConditions: { undertakeDepartmentId: this.valueId }
        }
      }).then(result => {
        // console.info("5");
        //console.log(result.data.data)
        this.ids = result.data.data;
      });
    },
    realExportList() {
      // console.info("ids");
      //console.log(this.ids);
      axios({
        method: "post",
        url: this.IP.IP + "/undertake/exportRegList",
        data: {
          ids: this.ids,
          time: this.regDate,
          undertakeDepartmentName: this.undertakeDPListName,
          undertakePersonName: this.undertakePRListName
        },
        responseType: "blob"
      })
        .then(result => {
          // console.info("zong");
          //console.log(result);
          this.downloadList(result);
          this.ids = [];
          this.undertakeDPListName = null;
          this.undertakePRListName = null;
          this.regDate = null;
          this.selectId = [];
          this.$Spin.hide();
        })
        .catch(error => {});
    },
    downloadList(data) {
      if (!data) {
        return;
      }
      var blob = new Blob([data], {
        type:
          "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"
      });
      var url = window.URL.createObjectURL(data.data);
      var aLink = document.createElement("a");
      aLink.style.display = "none";
      aLink.href = url;
      aLink.setAttribute("download", "projectRegList.xls");
      document.body.appendChild(aLink);
      aLink.click();
      document.body.removeChild(aLink); //下载完成移除元素
      window.URL.revokeObjectURL(url);
    },
    getAllHighSearch() {
      this.$ajax({
        method: "post",
        url: this.IP.IP + "/table/superSearchIds"
      }).then(result => {
        this.totalHigh = result.data.data.length;
        //console.log("空的高级查询总个数"+this.totalHigh);
      });
    },
    ClearCondition() {
      var i = 0;
      this.keyword = null;
      for (i = 0; i < this.rangeConditions.length; i++) {
        this.rangeConditions[i].sta = null;
        this.rangeConditions[i].end = null;
      }
      this.equalConditions.developmentOrganization = null;
      //this.equalConditions.state = null;
      this.equalConditions.hasArchived = null;
      this.equalConditions.editPersonId = null;
      this.equalConditions.finishDepartmentId = null;
      this.equalConditions.name = null;
      this.equalConditions.taskNumber = null;
      this.equalConditions.province = null;
      this.equalConditions.city = null;
      this.equalConditions.area = null;
      this.equalConditions.type = null;
      this.equalConditions.industryType = null;
      this.equalConditions.contractOrigin = null;
      this.equalConditions.hasUsualSealed = null;
      this.equalConditions.hasContract = null;
      this.equalConditions.businessFeeTag = null;
      this.specialConditions = [];
      this.spCollect = null;
      this.spState = null;
      this.spInvoice = null;
      this.spReward = null;
      this.spOutput = null;
    },
    HighClear() {
      this.ClearCondition();
      this.clearHigh = false;
      // console.log("rangeConditions", this.rangeConditions);
      // console.log("equalConditions", this.equalConditions);
      // console.log("specialConditions", this.specialConditions);
      // console.log("spCollect", this.spCollect);
      // console.log("spState", this.spState);
      // console.log("spInvoice", this.spInvoice);
      // console.log("spReward", this.spReward);
      // console.log("spOutput", this.spOutput);
    },
    cancelAdd() {
      this.undertakeHigh = false;
    },
    OpenhihgLevelSearch() {
      this.undertakeHigh = true;
    },
    hihgLevelSearch() {
      var u = this.IP.IP + "/table/superSearch";
      if (this.keyword) {
        u = this.IP.IP + "/table/superSearch?keyWord=" + this.keyword;
        this.checkAdd1();
      }
      this.pageNum = 1;
      this.$ajax({
        method: "post",
        url: u,
        params: {
          pageNum: this.pageNum,
          pageSize: 10,
          modelId: 2
        },
        data: {
          equalConditions: this.equalConditions,
          rangeConditions: this.rangeConditions,
          specialConditions: this.specialConditions,
          keyWord: this.keyword
        }
      }).then(result => {
        if (result.data.code == 0) {
          // console.info("高级查询结果");
          // console.log(result);
          this.data = result.data.data.data.list;
          var total = result.data.data.data.total;
          this.totalDataNo = total;
        } else {
          this.data = [];
          var msg = result.data.msg;
          this.$Message.error(msg);
        }
      });
    },
    hihgLevelSearch1() {
      var u = this.IP.IP + "/table/superSearch";
      if (this.keyword) {
        u = this.IP.IP + "/table/superSearch?keyWord=" + this.keyword;
      }
      this.$ajax({
        method: "post",
        url: u,
        params: {
          pageNum: this.pageNum,
          pageSize: 10,
          modelId: 2
        },
        data: {
          equalConditions: this.equalConditions,
          rangeConditions: this.rangeConditions,
          specialConditions: this.specialConditions,
          keyWord: this.keyword
        }
      }).then(result => {
        if (result.data.code == 0) {
          // console.info("高级查询结果");
          //console.log(result);
          this.data = result.data.data.data.list;
          //  var total = result.data.data.data.total;
          //  this.totalDataNo = total;
        } else {
          this.data = [];
          var msg = result.data.msg;
          this.$Message.error(msg);
        }
      });
    },
    addSpecial() {
      //添加进speciall
      // console.info("yewu");
      //console.log(this.spOutput);
      this.specialConditions = [];
      if (this.spState) {
        this.specialConditions.push(this.spState);
      }
      if (this.spCollect) {
        //处理收款
        this.specialConditions.push(this.spCollect);
      }
      if (this.spInvoice) {
        //处理发票
        this.specialConditions.push(this.spInvoice);
      }
      if (this.spReward) {
        //处理奖金
        this.specialConditions.push(this.spReward);
      }
      if (this.spOutput) {
        //处理业务开支
        if (this.spOutput == 2) {
          this.equalConditions.businessFeeTag = null;
          // console.info("111");
          this.specialConditions.push("businessFeeTag is null");
        } else {
          // console.info("222");
          this.equalConditions.businessFeeTag = this.spOutput;
        }
      } else if (this.spOutput == 0) {
        // console.info("222");
        this.equalConditions.businessFeeTag = this.spOutput;
      } else {
        this.equalConditions.businessFeeTag = null;
      }
    },
    setConditionNull() {
      var i = 0;
      if (!this.keyword) {
        this.keyword = null;
      }
      for (i = 0; i < this.rangeConditions.length; i++) {
        if (!this.rangeConditions[i].sta) {
          this.rangeConditions[i].sta = null;
        }
        if (!this.rangeConditions[i].end) {
          this.rangeConditions[i].end = null;
        }
      }
      for (i = 0; i < this.rangeConditions.length; i++) {
        if (this.rangeConditions[i].sta) {
          this.rangeConditions[i].sta = this.DateToString(
            this.rangeConditions[i].sta
          );
        }
        if (this.rangeConditions[i].end) {
          this.rangeConditions[i].end = this.DateToString(
            this.rangeConditions[i].end
          );
        }
      }
      if (!this.equalConditions.developmentOrganization) {
        //建设单位
        this.equalConditions.developmentOrganization = null;
      }

      if (!this.equalConditions.hasArchived) {
        //归档状态
        if (this.equalConditions.hasArchived != 0) {
          this.equalConditions.hasArchived = null;
        }
      }
      if (!this.equalConditions.editPersonId) {
        //编制人id
        this.equalConditions.editPersonId = null;
      }
      if (!this.equalConditions.finishDepartmentId) {
        //完成部门id
        this.equalConditions.finishDepartmentId = null;
      }

      if (!this.equalConditions.name) {
        //项目名称
        this.equalConditions.name = null;
      }
      if (!this.equalConditions.taskNumber) {
        //任务单编号
        this.equalConditions.taskNumber = null;
      }
      if (!this.equalConditions.province) {
        //省
        this.equalConditions.province = null;
      }
      if (!this.equalConditions.city) {
        //市
        this.equalConditions.city = null;
      }
      if (!this.equalConditions.area) {
        //区
        this.equalConditions.area = null;
      }
      if (!this.equalConditions.type) {
        //项目类别
        this.equalConditions.type = null;
      }
      if (!this.equalConditions.industryType) {
        //行业类别
        this.equalConditions.industryType = null;
      }
      if (!this.equalConditions.contractOrigin) {
        //合同归属单位
        this.equalConditions.contractOrigin = null;
      }
      if (!this.equalConditions.hasUsualSealed) {
        //盖章状态
        if (this.equalConditions.hasUsualSealed != 0) {
          this.equalConditions.hasUsualSealed = null;
        }
      }
      if (!this.equalConditions.hasContract) {
        //合同有无
        if (this.equalConditions.hasContract != 0) {
          this.equalConditions.hasContract = null;
        }
      }
      if (!this.equalConditions.businessFeeTag) {
        //业务开支有无
        if (this.equalConditions.businessFeeTag != 0) {
          this.equalConditions.businessFeeTag = null;
        }
      }
    },
    checkAdd1() {
      this.setConditionNull(); //空字符串变null
      this.addSpecial();
      this.undertakeHigh = false;
      this.clearHigh = true;
    },
    checkAdd(name) {
      this.$refs[name].validate(valid => {
        if (valid) {
          this.setConditionNull(); //空字符串变null
          this.addSpecial();
          this.undertakeHigh = false;
          this.clearHigh = true;
          // console.info("equal");
          // console.log(this.rangeConditions);
        } else {
          this.$Message.error("格式错误!");
        }
      });
    },
    getEditpersonList() {
      axios({
        method: "get",
        url: this.IP.IP + "/personInfo/getEditPerson"
      }).then(result => {
        var total = result.data.data.length;
        var list = result.data.data;
        for (var i = 0; i < total; i++) {
          this.editPerList.push({
            id: list[i].personId + "",
            name: list[i].personName + ""
          });
        }
        // console.info("编制人名单");
        //console.log(this.editPerList);
      });
    },
    getCarerType() {
      axios({
        method: "get",
        url: this.IP.IP + "/getIndustryTypes?pageNumber=" + 1
      }).then(result => {
        var total = result.data.data.total;
        var list = result.data.data.list;
        for (var i = 0; i < total; i++) {
          this.carerType.push({
            id: list[i].id + "",
            name: list[i].name + ""
          });
        }
        // console.info("行业类别名单");
        //console.log(this.carerType);
      });
    },
    geteditPeo() {
      axios({
        method: "get",
        url: this.IP.IP + "/getProjectTypes?pageNumber=" + 1
      }).then(result => {
        var total = result.data.data.length;
        var list = result.data.data;
        // for(var i=0;i<total;i++){
        //   this.proType.push({
        //     id:list[i].id+'',
        //     name:list[i].name+''
        //   })

        // }
        // console.info("编制人员名单");
        //console.log(this.proType);
      });
    },
    getproType() {
      axios({
        method: "get",
        url: this.IP.IP + "/getProjectTypes?pageNumber=" + 1
      }).then(result => {
        var total = result.data.data.total;
        var list = result.data.data.list;
        for (var i = 0; i < total; i++) {
          this.proType.push({
            id: list[i].id + "",
            name: list[i].name + ""
          });
        }
        // console.info("项目类别");
        //console.log(this.proType);
      });
    },
    getNewData1() {
      this.data = [];
      if (this.valueId != 0) {
        this.select1 = this.valueId;
      }
      if (this.model1 != 0) {
        this.select2 = this.model1;
      }
      if (this.model2 != 0) {
        this.select3 = this.model2 + "";
      }
      // console.info("select123");
      //console.log(this.select1);
      //console.log(this.select2);
      //console.log(this.select3);
      this.$ajax({
        method: "post",
        url: this.IP.IP + "/table/show",
        params: {
          pageNum: this.pageNum,
          pageSize: 10,
          modelId: 2
        },
        data: {
          undertakePersonId: this.select2,
          undertakeDepartmentId: this.select1,
          registDate: this.select3
        }
      }).then(response => {
        this.data = response.data.data.data.list;
        //console.info('111');
        ////console.log(fields);
        // var total = response.data.data.data.total;
        // this.totalDataNo = total;
        // console.info("total");
        // //console.log(this.totalDataNo);
        this.select1 = null;
        this.select2 = null;
        this.select3 = null;
      });
    },
    getpageNum(e) {
      // console.info("当前页");
      //console.log(e);
      this.pageNum = e;
      if (this.clearHigh) {
        this.hihgLevelSearch1();
      } else {
        this.getNewData1();
      }
    },
    geteditInfo() {
      axios({
        method: "get",
        url: this.IP.IP + "/undertake/getUndertake?projectId=" + this.row
      }).then(result => {
        // console.log(result);
        this.editinfo = result.data.data;
        this.editstartDate = result.data.data.startDate;
        this.editcontractDate = result.data.data.contractDate;
        this.editinfo.finishDepartmentId =
          result.data.data.finishDepartmentId + "";
        this.editinfo.undertake_departmentId =
          result.data.data.undertakeDepartmentId + "";
        this.editinfo.undertakePersonId =
          result.data.data.undertakePersonId + "";
        this.editinfo.industryType = result.data.data.industryType + "";
        this.editinfo.type = result.data.data.type + "";
        this.editinfo.editPersonId = result.data.data.editPersonId + "";
        this.editinfo.timeLimit = result.data.data.timeLimit + "";
        this.editinfo.fund = result.data.data.fund + "";
        this.corse1.label = result.data.data.province;
        this.corse2.label = result.data.data.city;
        this.corse3.label = result.data.data.area;
        if (!result.data.data.contactPhone) {
          this.editinfo.contactPhone = "";
        }
        if (this.editinfo.editPersonId == "undefined") {
          this.editinfo.editPersonId = null;
        }
        if (this.editinfo.finishDepartmentId == "undefined") {
          this.editinfo.finishDepartmentId = null;
        }
        if (this.editinfo.industryType == "undefined") {
          this.editinfo.industryType = null;
        }
        if (this.editinfo.timeLimit == "undefined") {
          this.editinfo.timeLimit = null;
        }
        if (this.editinfo.fund == "undefined") {
          this.editinfo.fund = null;
        }

        // console.log("edit", this.editinfo);
        this.choseProvince(this.corse1);
        this.choseCity(this.corse2);
        this.choseBlock(this.corse3);
      });
    },
    insertIntoSubmit() {
      this.submitCreateinfo.undertakeDepartmentId = this.newinfo.undertakeDepartmentId;
      this.submitCreateinfo.undertakePersonId = this.newinfo.undertakePersonId;
      this.submitCreateinfo.taskNumber = this.newinfo.taskNumber;
      this.submitCreateinfo.finishDepartmentId = this.newinfo.finishDepartmentId;
      this.submitCreateinfo.editPersonId = this.newinfo.editPersonId;
      this.submitCreateinfo.registDate = this.newinfo.registDate;
      this.submitCreateinfo.name = this.newinfo.name;
      this.submitCreateinfo.industryType = this.newinfo.industryType;
      this.submitCreateinfo.type = Number(this.newinfo.type); //不知道为什么type一定要数字
      this.submitCreateinfo.contractDate = this.DateToString(
        this.newinfo.contractDate
      );
      this.submitCreateinfo.startDate = this.DateToString(
        this.newinfo.startDate
      );
      this.submitCreateinfo.timeLimit = this.newinfo.timeLimit;
      this.submitCreateinfo.developmentOrganization = this.newinfo.developmentOrganization;
      this.submitCreateinfo.province = this.newinfo.province;
      this.submitCreateinfo.city = this.newinfo.city;
      this.submitCreateinfo.area = this.newinfo.area;
      this.submitCreateinfo.address = this.newinfo.address;
      this.submitCreateinfo.contact = this.newinfo.contact;
      this.submitCreateinfo.contactPhone = this.newinfo.contactPhone;
      this.submitCreateinfo.taxNumber = this.newinfo.taxNumber;
      this.submitCreateinfo.bankName = this.newinfo.bankName;
      this.submitCreateinfo.bankAccount = this.newinfo.bankAccount;
      this.submitCreateinfo.fund = this.newinfo.fund;
      this.submitCreateinfo.contractOrigin = this.newinfo.contractOrigin;
      this.submitCreateinfo.remark = this.newinfo.remark;
    },
    DateToString(date) {
      var year = date.getFullYear();
      var month = date.getMonth() + 1;
      var day = date.getDate();
      if (month < 10) {
        var newmonth = "0" + month;
        month = newmonth;
      }
      if (day < 10) {
        var newday = "0" + day;
        day = newday;
      }
      var sDate = year + "-" + month + "-" + day;
      return sDate;
    },
    realCreate() {
      this.$ajax({
        method: "post",
        url: this.IP.IP + "/undertake/undertakeProject",
        params: {},
        data: this.submitCreateinfo
      })
        .then(result => {
          // console.info("确定新建");
          //console.log(result);
          var code = "";
          code = result.data.code;
          var msg = result.data.msg;
          if (code == 0) {
            this.$Message.success("新建承接项目成功");
            this.getNewData1();
            this.resetnewinfo();
          } else {
            this.$Message.error(msg);
          }
          this.undertakeCreate = false;
        })
        .catch(error => {
          this.$Message.error("填写格式不正确");
        });
    },
    checkPhone(phone) {
      var strTemp = /^1[3|4|5|6|7|8|9][0-9]{9}$/;
      var isPhone = /^([0-9]{ph3,4}-)?[0-9]{7,8}$/;
      if (strTemp.test(phone) || isPhone.test(phone)) {
        return 1;
      } else {
        return 2;
      }
    },
    submitCreate(name) {
      let that = this;
      var flag = 2;
      this.$refs[name].validate(valid => {
        if (valid) {
          if (this.newinfo.contactPhone != null) {
            flag = this.checkPhone(this.newinfo.contactPhone);
          } else {
            flag = 0;
          }
          if (1) {
            this.newinfo.undertakeDepartmentId = this.userDepmentID;
            this.newinfo.undertakePersonId = this.userID;
            this.insertIntoSubmit();
            // console.info("信息");
            // console.log(this.submitCreateinfo);
            this.realCreate();
          } else if (flag == 2) {
            this.$Message.error("联系方式格式不正确!");
            // console.info("new");
          } else {
            this.$Message.error("填写不正确!");
          }
        } else {
          this.$Message.error("填写不完整!");
        }
      });
    },
    getUserInfo() {
      axios({
        method: "get",
        url: this.IP.IP + "/personAndDepartment"
      }).then(result => {
        // console.info("用户信息");
        //console.log(result);
        this.userName = result.data.data.personName;
        this.userDepment = result.data.data.departmentName;
        this.userID = result.data.data.personId;
        this.userDepmentID = result.data.data.departmentId;
      });
    },
    resetnewinfo() {
      this.newinfo.undertakeDepartmentId = null;
      this.newinfo.undertakePersonId = null;
      this.newinfo.taskNumber = null;
      this.newinfo.finishDepartmentId = null;
      this.newinfo.editPersonId = null;
      this.newinfo.registDate = null;
      this.newinfo.name = null;
      this.newinfo.industryType = null;
      this.newinfo.type = null;
      this.newinfo.contractDate = null;
      this.newinfo.startDate = null;
      this.newinfo.timeLimit = null;
      this.newinfo.developmentOrganization = null;
      this.newinfo.province = null;
      this.newinfo.city = null;
      this.newinfo.area = null;
      this.newinfo.address = null;
      this.newinfo.contact = null;
      this.newinfo.contactPhone = null;
      this.newinfo.taxNumber = null;
      this.newinfo.bankName = null;
      this.newinfo.bankAccount = null;
      this.newinfo.fund = null;
      this.newinfo.contractOrigin = null;
      this.newinfo.remark = null;
      this.proEditPeo=[];
    },
    closeundertakeCreate() {
      let that = this;
      this.$Modal.confirm({
        title: "确定关闭吗？",
        onOk() {
          that.resetnewinfo();
          that.undertakeCreate = false;
        }
      });
    },
    createproject() {
      this.undertakeCreate = true;
      this.newinfo.undertakeDepartmentId = this.userDepment;
      this.newinfo.undertakePersonId = this.userName;
      this.newinfo.registDate = this.nowDate;
    },
    setBackdata(st) {
      //console.log(this.row);
      this.callbackdata = this.row;
      this.callbackState = st;
    },
    getdepartments() {
      axios({
        method: "get",
        url: this.IP.IP + "/getDepartments"
      }).then(result => {
        // console.info("部门信息");
        // console.log(result);
        var data = result.data.data;
        this.dataTree = [];
        var i = 0;
        for (i = 0; i < data.length; i++) {
          this.setNode(data[i]);
        }
        this.dataTree = data;
        this.dataTree.unshift({ value: 0, label: "全部", children: [] });
        // console.info("部门树");
        //console.log(this.dataTree);
        // console.info("部门列表");
        //console.log(this.dptList);
        //console.info('')
        ////console.log(this.valueId);
      });
    },
    setNode(node) {
      if (node != null) {
        node.label = node.nodeDepartmentIndex.name;
        node.value = node.nodeDepartmentIndex.id;
        node.children = node.childrenDepartmentIndexes;
        this.dptList.push({
          id: node.value + "",
          name: node.label
        });
        var i = 0;
        for (i = 0; i < node.childrenDepartmentIndexes.length; i++) {
          this.setNode(node.childrenDepartmentIndexes[i]);
        }
      }
    },
    getpersonPage() {
      axios({
        method: "get",
        url:
          this.IP.IP +
          "/getDepartmentsConsistent?departmentId=" +
          this.valueId +
          "&pageNumber=1&pageSize=5"
      }).then(result => {
        //this.personName = result.data.data.list;
        if (result.data.code == 0) {
          this.perNo = result.data.data.pages;
          // console.info("页数");
          //console.log(this.perNo);
          this.getperson();
        }
      });
    },
    getperson() {
      var i = 0;
      for (i = 1; i <= this.perNo; i++) {
        axios({
          method: "get",
          url:
            this.IP.IP +
            "/getDepartmentsConsistent?departmentId=" +
            this.valueId +
            "&pageNumber=" +
            i +
            "&pageSize=5"
        }).then(result => {
          var size = result.data.data.size;
          var list = result.data.data.list;
          this.personName = this.personName.concat(list);
        });
      }
      //this.personName.unshift({ id: 0, name: "全部" });
      // console.info("人员名单");
      //console.log(this.personName);
    },
    getFinDep(e){
      // console.log(e.value);
      this.proEditPeo=[];
      this.changeEditPeo(e.value);
    },
    changeEditPeo(id){
      axios({
        method: "get",
        url: this.IP.IP + "/personInfo/getEtPsnByDeId?departmentId="+id
      }).then(result => {
        //this.personName = result.data.data.list;
        if (result.data.code == 0) {
          // this.perNo = result.data.data;
          // console.info("页数");
          // console.log(this.perNo);
          // this.getperson();
          var perno=result.data.data;
          if (perno) {
            for (var i = 0; i < perno.length; i++) {
              this.proEditPeo.push({
                id: perno[i].personId + "",
                name: perno[i].personName + ""
              });
            }
          }
        }
      });

    },
    getperId(e) {
      //console.log(e);
      this.valueId2 = e.value;
      if (e.value != 0) {
        this.undertakePRListName = e.label;
      }

      // console.info("选中人员ID");
      //console.log(this.valueId2);
      // console.info("部门选择不是全部的MOdal1的值");
      //console.log(this.model1);
    },
    format(labels, selectedData) {
      const index = labels.length - 1;
      const data = selectedData[index] || false;
      if (data && data.code) {
        return labels[index];
      }
      return labels[index];
    },
    getValue(e) {
       var i = e.length;
      this.valueId = e[i - 1];
      if (this.valueId != 0) {
        this.personName = [{ id: 0, name: "全部" }];
        this.getpersonPage();
      } else {
        this.model1 = 0;
        this.personName = [{ id: 0, name: "全部" }];
      }
    },
    getNowYear() {
      var date = new Date();
      var year = date.getFullYear();
      var month = date.getMonth() + 1;
      var day = date.getDate();
      if (month < 10) {
        var newmonth = "0" + month;
        month = newmonth;
      }
      if (day < 10) {
        var newday = "0" + day;
        day = newday;
      }
      var sDate = year + "-" + month + "-" + day;
      this.nowyear = year;
      this.nowDate = sDate;
      // console.info("当前年");
      //console.log(this.nowyear);
      //console.log(this.nowDate);
      for (var i = 2005; i <= this.nowyear; i++) {
        this.yearName.push({ id: i, name: i + "" });
      }
      this.yearName.unshift({ id: 0, name: "全部" });
      // console.info("年份数组");
      //console.log(this.yearName);
    },
    getyear(e) {
      //console.log(this.model2);
    },
    //select获取选择的data全部信息
    selectChange: function(date) {
      this.selectId = date;
      //console.log(this.selectId);
    },
    getNewData() {
      this.data = [];
      if (this.valueId != 0) {
        this.select1 = this.valueId;
      }
      if (this.model1 != 0) {
        this.select2 = this.model1;
      }
      if (this.model2 != 0) {
        this.select3 = this.model2 + "";
      }
      // console.info("select123");
      //console.log(this.select1);
      //console.log(this.select2);
      //console.log(this.select3);
      this.$ajax({
        method: "post",
        url: this.IP.IP + "/table/show",
        params: {
          pageNum: 1,
          pageSize: 10,
          modelId: 2
        },
        data: {
          undertakePersonId: this.select2,
          undertakeDepartmentId: this.select1,
          registDate: this.select3
        }
      }).then(response => {
        this.data = response.data.data.data.list;
        //console.info('111');
        ////console.log(fields);
        var total = response.data.data.data.total;
        this.totalDataNo = total;
        // console.info("total");
        //console.log(this.totalDataNo);
        this.select1 = null;
        this.select2 = null;
        this.select3 = null;
      });
    },
    getcolumns() {
      axios({
        method: "post",
        url:
          this.IP.IP +
          "/table/show?pageNum=" +
          this.pageNum +
          "&pageSize=" +
          this.pageSize +
          "&modelId=" +
          this.modelId
      }).then(result => {
        let that = this;

        var fields = result.data.data.fields;
        var attribute = result.data.data.attribute;
        //var list=result.data.data.data.list;
        var i = 0;
        //console.log(result);
        for (i; i < fields.length; i++) {
          this.columns.push({
            title: fields[i],
            width: 160,
            key: attribute[i]
          });
        }
        //this.data=list;
      });
    },

    getTable() {
      axios({
        method: "post",
        url:
          this.IP.IP +
          "/table/show?pageNum=" +
          this.pageNum +
          "&pageSize=" +
          this.pageSize +
          "&modelId=" +
          this.modelId
      }).then(result => {
        let that = this;

        var list = result.data.data.data.list;
        //var i=0;
        //console.log(result);

        this.data = list;
      });
    },
    insertEdit() {
      this.submiteditinfo.undertakeDepartmentId = this.editinfo.undertake_departmentId;
      this.submiteditinfo.undertakePersonId = this.editinfo.undertakePersonId;
      this.submiteditinfo.taskNumber = this.editinfo.taskNumber;
      this.submiteditinfo.finishDepartmentId = this.editinfo.finishDepartmentId;
      this.submiteditinfo.editPersonId = this.editinfo.editPersonId;
      this.submiteditinfo.registDate = this.editinfo.registDate;
      this.submiteditinfo.name = this.editinfo.name;
      this.submiteditinfo.industryType = this.editinfo.industryType;
      this.submiteditinfo.type = this.editinfo.type;
      if (this.editinfo.contractDate != this.editcontractDate) {
        this.submiteditinfo.contractDate = this.DateToString(
          this.editinfo.contractDate
        );
      } else {
        this.submiteditinfo.contractDate = this.editcontractDate;
      }
      if (this.editinfo.startDate != this.editstartDate) {
        this.submiteditinfo.startDate = this.DateToString(
          this.editinfo.startDate
        );
      } else {
        this.submiteditinfo.startDate = this.editstartDate;
      }
      // this.submiteditinfo.startDate=this.DateToString(this.editinfo.startDate);
      this.submiteditinfo.timeLimit = Number(this.editinfo.timeLimit);
      this.submiteditinfo.developmentOrganization = this.editinfo.developmentOrganization;
      this.submiteditinfo.province = this.editinfo.province;
      this.submiteditinfo.city = this.editinfo.city;
      this.submiteditinfo.area = this.editinfo.area;
      this.submiteditinfo.address = this.editinfo.address;
      this.submiteditinfo.contact = this.editinfo.contact;
      this.submiteditinfo.contactPhone = this.editinfo.contactPhone;
      this.submiteditinfo.taxNumber = this.editinfo.taxNumber;
      this.submiteditinfo.bankName = this.editinfo.bankName;
      this.submiteditinfo.bankAccount = this.editinfo.bankAccount;
      this.submiteditinfo.fund = Number(this.editinfo.fund);
      this.submiteditinfo.contractOrigin = this.editinfo.contractOrigin;
      this.submiteditinfo.remark = this.editinfo.remark;
      this.submiteditinfo.projectId = this.editinfo.projectId;
    },
    realEdit() {
      this.$ajax({
        method: "post",
        url: this.IP.IP + "/undertake/revise",
        params: {},
        data: this.submiteditinfo
      }).then(result => {
        // console.info("确认修改");
        //console.log(result);
        var code = "";
        code = result.data.code;
        var msg = result.data.msg;
        if (code == 0) {
          this.$Message.success("修改成功");
          this.undertakeDtailedit = false;
        } else {
          this.$Message.error(msg);
        }
        //this.undertakeCreate=false;
      });
    },
    submitundertakeedit(name) {
      this.$refs[name].validate(valid => {
        if (valid) {
          this.insertEdit();
          // console.info("信息");
          // console.log(this.submiteditinfo);
          this.realEdit();
        } else {
          this.$Message.error("填写不完整!");
        }
      });
    },
    closeundertakedtail() {
      let that = this;
      this.$Modal.confirm({
        title: "确定关闭吗？",
        onOk() {
          that.undertakeDtaildetail = false;
        }
      });
    },
    closeundertakeedit() {
      let that = this;
      this.$Modal.confirm({
        title: "确定关闭吗？",
        onOk() {
          that.undertakeDtailedit = false;
        }
      });
    },
    comfirmabandon() {
      //console.log(this.row);
      axios({
        method: "get",
        url: this.IP.IP + "/undertake/discardProject?projectId=" + this.row
      })
        .then(result => {
          let that = this;
          var code = "";
          code = result.data.code;
          //console.log(result.data.msg);
          if (code == -1) {
            alert(result.data.msg);
          } else {
            alert("废弃成功！");
          }
          this.$router.go(0);
        })
        .catch(error => {
          alert(error);
        });
      this.row = {};
    },
    abandonCancel() {
      this.remark = "";
    },
    changeNews() {
      if (this.which == "easynews") {
        this.which = "authorizenews";
      } else {
        this.which = "easynews";
      }
    }
  }
};
</script>
<style>
.search-block1 {
  padding: 5px;
  display: inline-block;
  width: 180px;
  height: 50px;
}
.ivu-steps .ivu-steps-head {
  background: #efefef;
}
.ivu-steps .ivu-steps-title {
  display: inline-block;
  margin-bottom: 4px;
  padding-right: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #666;
  background: #efefef;
}
.swith-btn {
  padding: 5px;
}
.search-bar {
  width: 100%;
}
.search-block {
  padding: 5px;
  display: inline-block;
  width: 300px;
  height: 50px;
}
.search-block span {
  line-height: 50px;
}
.search-block .ivu-select {
  width: 150px;
}
.senior-search-block {
  height: 50px;
  padding: 5px;
}
.search-content {
  width: 200px;
}
.undertake-title {
  margin: 10px 5px;
  font-size: 15px;
  padding: 5px;
  color: #000000;
  border-bottom: 1px solid #cdcdcd;
  -webkit-transition-duration: 0.4s;
  transition-duration: 0.4s;
}
.bidding-block-enter-active,
.bidding-block-leave-active {
  transition: all 0.3s ease;
}
.bidding-block-enter,
.bidding-block-leave-to {
  transform: scale(0.9);
  opacity: 0;
}
.bidding-block {
  z-index: 1010;
  overflow-y: auto;
  left: 0;
  top: 0;
  position: fixed;
  width: 100%;
  height: 100%;
  background: #efefef;
}
.bidding-body {
  padding: 20px;
}
.bidding-modal {
  z-index: 1051;
}
.bidding-block-top {
  font-size: 15px;
  border-bottom: 1px solid #cdcdcd;
  background: #efefef;
}
.bidding-block-close {
  cursor: pointer;
  display: inline-block;
  border-right: 1px solid #cdcdcd;
  font-size: 20px;
  padding: 0 5px;
}
.bidding-title {
  margin: 10px 5px;
  font-size: 15px;
  padding: 5px;
  color: #000000;
  border-bottom: 1px solid #cdcdcd;
}
.bidding-content {
  padding: 10px 5px;
  border-bottom: 1px dashed #cdcdcd;
}
.bidding-item {
  display: inline-block;
  font-size: 12px;
}
.bidding-item p {
  display: inline-block;
  width: 100px;
}
.bidding-suffix {
  margin-right: 5px;
}
.ivu-input[disabled],
.ivu-input-number-input[disabled] {
  color: #000000;
}
.bidding-item-input {
  width: 200px;
}
.bidding-sum {
  margin-left: 10px;
  font-weight: bold;
  color: #27a9e3;
}
.bidding-list-item {
  margin-bottom: 5px;
}
.demo-spin-icon-load {
  animation: ani-demo-spin 1s linear infinite;
}
</style>